home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigantic Games 2
/
Gigantic Games 2.iso
/
pc
/
_r_
/
rocky
/
std
< prev
Wrap
Text File
|
1994-12-23
|
2KB
|
138 lines
***************************************************************************
* MACRO instructions
* ------------------
* (pseudo instruction set extension)
***************************************************************************
* FEDCBA98 76543210 ;whole register is SR; lower byte is CCR
* T-S--III ---XNZVC
sec MACRO ;function : set the CARRY flag
ori.b #%00001,CCR
ENDM
clc MACRO ;function : clear the CARRY flag
andi.b #$FF-1,CCR
ENDM
sez MACRO ;function : set the ZERO flag
ori.b #%00100,CCR
ENDM
clz MACRO ;function : clear the ZERO flag
andi.b #$FF-4,CCR
ENDM
req MACRO ;function : return if ZERO
beq dummy
ENDM
rne MACRO ;function : return if NOT ZERO
bne dummy
ENDM
rcc MACRO ;function : return if CARRY CLEAR
bcc dummy
ENDM
rcs MACRO ;function : return if CARRY SET
bcs dummy
ENDM
rpl MACRO ;function : return if POSITIVE
bpl dummy
ENDM
rmi MACRO ;function : return if NEGATIVE
bmi dummy
ENDM
clrh MACRO ;Dn ;function : ANDI.L #$0000FFFF,Dn
swap \1
clr.w \1
swap \1
ENDM
MODULO MACRO ;DANGER : HUGE LOOP POSSIBILITY
sub.w \2,\1
bpl.s *-2
add.w \2,\1
ENDM
EXEC MACRO ;call an EXEC system function
jsr _LVO\1(a6)
ENDM
DOS MACRO ;call an AmigaDOS system function
jsr _LVO\1(a6)
ENDM
GFX MACRO ;call a graphics system function
jsr _LVO\1(a6)
ENDM
INTUI MACRO ;call an Intuition system function
jsr _LVO\1(a6)
ENDM
LSTRING MACRO ;usage: STRING labelid,<'string parameter'>
\1 dc.w \1_e-\1_s
\1_s dc.b \2
\1_e
ENDM
LSTRINGR MACRO
\1 dc.w \1_e-\1_s
\1_s dc.b \2,LF
\1_e
ENDM
PRINT_AT MACRO ;usage: PRINT_AT x,y,labelid,<'your string'>
dc.w \1,\2
\3 dc.w \3_e-\3_s
\3_s dc.b \4
\3_e
ENDM
***************************************************************************
* Software Constants
* ------------------
***************************************************************************
TRUE equ -1
FALSE equ 0
NULL equ 0
; Names of common ASCII codes
SOH equ $01
TAB equ $09
FF equ $0C
SHIFT_OUT equ $0E
SHIFT_IN equ $0F
ESC equ $1B
DOUBLE_QUOTE equ $22
SINGLE_QUOTE equ $27
COMMA equ $2C
SPC equ $20
CLS equ FF ;Form Feed is used to clear screen
; Common Amiga 4096 colors
RED equ $f00
GREEN equ $0f0
BLUE equ $00f
YELLOW equ RED+GREEN
CYAN equ GREEN+BLUE
MAGENTA equ RED+BLUE
WHITE equ $FFF
GREY equ $777
BLACK equ $000
_AbsExecBase equ 4
CUSTOM_BASE equ $DFF000
COLOR_BASE equ $DFF180